package com.srlg.liteflow.remote;

import com.srlg.liteflow.model.dto.User;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.service.annotation.GetExchange;
import org.springframework.web.service.annotation.HttpExchange;
import org.springframework.web.service.annotation.PostExchange;

/**
 * 远程调用接口
 */
@HttpExchange("api")
public interface RemoteService {

    /**
     *
     * @param id 主键
     * @return
     */
    @GetExchange("query/{id}")
    ResponseEntity<User> query(@PathVariable Long id);

    /**
     *
     * @param user
     * @param token
     * @return
     */
    @PostExchange("create")
    ResponseEntity<String> create(@RequestBody User user,
                                  @RequestHeader(required = false, name = "Authorization") String token);
}
